package src.io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class MyObjectSerial  {
    public static void main(String[] args) throws Exception{
       /* ObjectOutputStream o =new ObjectOutputStream(new FileOutputStream("demo/Teacher.txt"));
        Teacher teacher=new Teacher();
        teacher.setAge(30);
        teacher.setName("��˹");
        o.writeObject(teacher);
        o.close();*/
        ObjectInputStream o=new ObjectInputStream(new FileInputStream("demo/Teacher.txt"));
        Teacher t=(Teacher) o.readObject();
        System.out.println(t);
        o.close();
    }
}
